#include "NCGM.h"


//NCGM::NCGM(int max_iter,double eps){
//_eps = eps;
//_max_iter = max_iter;
//Vector _p_k_1(_size);
//Vector _p_k(_size);
//Vector _s_k(_size);
//Vector _r_k_1(_size);
//Vector _r_k(_size);
//Vector _z_k(_size);
//Vector _x_k(_size);
//}


//NCGM::~NCGM()
//{
//     
//}


/*Vector& NCGM::calculate(){

_r_k_1 = b - A*x;
_p_k = _r_k_1;
_z_k = _r_k_1;
_s_k = _r_k_1;

Vector s_k_temp(_size);
Vector A_z_k(_size);
int k = 1;
do{

_alpha = (_p_k_1.scalar(_r_k_1)) / (_s_k.scalar(A_z_k));
_x_k = _x_k + _alpha*_z_k;
_r_k = _r_k_1 - _alpha*(A_z_k);
A.transposedMultipliedToVector(_s_k, s_k_temp);
_p_k = _p_k_1 - _alpha*s_k_temp;
_beta = (_p_k.scalar(_r_k)) / (_p_k_1.scalar(_r_k_1));
_z_k = _r_k + _beta*_z_k;
_s_k = _p_k + _beta*_s_k;

_r_k_1 = _r_k;
_p_k_1 = _p_k;
k++;
} while (_z_k.norm() > _eps&&k < _max_iter)

return *_x_k;
}*/
